#!/user/bin/env python3
#! encoding: utf-8
from flask import (Blueprint, Response, abort, flash, redirect,
                   render_template, request, url_for)

from models.base import db
from models.server import Url_address, app_path_map

main = Blueprint('address', __name__)

@main.route("/")
def index():
    u = Url_address
    a = app_path_map
    apps = db.query(u.id,u.IP,u.port,u.NAT_IP,u.NAT_port,u.login_name,u.login_password, 
            a.app_name, a.path_prefix, a.path_suffix,).filter(
                u.domain=='MGL',u.app_code==a.app_code).all()
    Bengal = apps
    return render_template("address.html", BengalAPP=Bengal)

